package mint.modules.generator;

public class CounterManager {
	private int labelCounter;
	private int localCounter;
	private int parametersCounter;
	private static CounterManager labelManager = null;
	
	private CounterManager()
	{
		labelCounter = 1;
		initializeLocal();
	}
	
	public String generate(String name)
	{
		String resp = name + labelCounter;
		++labelCounter;
		
		return resp;
	}
	
	public static CounterManager getInstance()
	{
		if (labelManager == null)
		{
			labelManager = new CounterManager();
		}
		
		return labelManager;
	}
	
	public void initializeLocal()
	{
		localCounter = 1;
		parametersCounter = 0;
	}
	
	public int getNewLocal()
	{
		return localCounter++;
	}
	
	public int getLocalNumber()
	{
		return localCounter;
	}
	
	public int incrementParameter()
	{
		return ++parametersCounter;
	}

}
